//
//  RiskListCell.m
//  nova
//
//  Created by OSX on 8/17/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "RiskListCell.h"
#import "Risk.h"
#import "RiskViewer.h"

@implementation RiskListCell

@synthesize riskView;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        CGRect rFrame = CGRectMake(0.0, 0.0, self.contentView.bounds.size.width, self.contentView.bounds.size.height);
        riskView = [[RiskViewer alloc] initWithFrame:rFrame];
        riskView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        [self.contentView addSubview:riskView];
        
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void)setRisk:(Risk *)newRisk{
    riskView.risk = newRisk;
}

- (void)redisplay{
    [riskView setNeedsDisplay];
}

- (void)dealloc
{
    [riskView release];
    [super dealloc];
}

@end
